Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add micromark-extension-math to enable TeX block in Markdown #5332

Merged
merged 7 commits into from
Oct 25, 2024

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Oct 25, 2024

Changelog Entry

Added

Description

After we migrated to micromark in PR #5330, this PR will add micromark-extension-math to enable $$ block for maths.

It will use KaTeX to convert TeX inside the block into MathML <math>.

Design

We explicitly disabled $ (inline math block) to prevent collision.

Using MathML as output will not require CSS/WOFF2 which could add up bundle size, with tradeoff of visualization quality. We will tackle this issue later.

The micromark-extension-math package is contributing roughly 260 KiB (9%) to our bundle size.

Accessibility is done by the browser for MathML.

Specific Changes

  • Added micromark-extension-math package
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review October 25, 2024 06:00
Copy link
Collaborator

@OEvgeny OEvgeny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful!

@compulim compulim merged commit 51385f7 into microsoft:main Oct 25, 2024
25 checks passed
@compulim compulim deleted the feat-mathml branch October 25, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants